/

Profiling geoserver 2.1.2 using YourKit Java Profiler 9

[Load Testing Geoserver]

[background] jmeter

  • Load testing is done using Apache JMeter 2.5.1 r1177103
  • A text file with the url (including random bbox, not scaled) is loaded by JMeter
  • YourKit Java Profiler 9 is used to profile geoserver
  • An image file 4.5GB in size is served.
  • The urls are generated using the following python script:
import random
#http://10.1.1.2:8080/geoserver/don/wms?service=WMS&version=1.1.0&request=GetMap&layers=don:china&styles=&bbox=73.115,19.934,135.103,53.597&width=607&height=330&srs=EPSG:4326&format=image/png
minx = 73.115
miny = 19.934
maxx = 78.103
maxy = 23.597
thefile = open('geoload2.txt', 'w')
wms1 = 'geoserver/don/wms?service=WMS&version=1.1.0&request=GetMap&layers=don:china&styles=&width=800&height=600&srs=EPSG:4326&format=image/png&bbox='
distancex = maxx - minx
distancey = maxy - miny
for n in range(1000):
minx1 = minx + random.random() * distancex
miny1 = miny + random.random() * distancey
thefile.write( wms1 + str(minx1) + ',' + str(miny1) + ',' + str(maxx) + ',' + str(maxy) + '\n' );

[load-testing-shape-file]
Serving up a 150MB shape file as WMS,
The throughput is about 2.2 per second

throughput

Stack trace of one of the hotspot org.geotools.index.quadtree.LazySearchIterator.hasNext() which is called 50% of the time, can be seen in the appendix section below.

[to-do]

  1. Reduce the number of filters and see if it performs better. -> no it doesn’t improve throughput in measurable amount. will check if cpu usage is significantly less.

[appendix]

"Name","Time (ms)","Invocation Count"
"org.geotools.index.quadtree.LazySearchIterator.hasNext()","287819","76580"
"org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getAttributesReader(boolean, boolean, Query, SimpleFeatureType)","286712","57"
"org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getFeatureReader(String, Query)","",""
"org.geotools.data.AbstractDataStore.getFeatureReader(Query, Transaction)","",""
"org.geotools.data.DefaultFeatureResults.reader()","",""
"org.geotools.data.store.DataFeatureCollection.openIterator()","",""
"org.geotools.data.store.DataFeatureCollection.iterator()","",""
"org.geotools.data.store.DataFeatureCollection.features()","",""
"org.geotools.data.store.DataFeatureCollection.features()","",""
"org.geotools.data.crs.ForceCoordinateSystemFeatureResults.openIterator()","",""
"org.geotools.feature.collection.AbstractFeatureCollection.iterator()","",""
"org.geotools.renderer.lite.StreamingRenderer.drawPlain(Graphics2D, MapLayer, AffineTransform, CoordinateReferenceSystem, String, Collection, FeatureCollection, NumberRange, ArrayList)","",""
"org.geotools.renderer.lite.StreamingRenderer.processStylers(Graphics2D, MapLayer, AffineTransform, CoordinateReferenceSystem, Envelope, Rectangle, String)","",""
"org.geotools.renderer.lite.StreamingRenderer.paint(Graphics2D, Rectangle, ReferencedEnvelope, AffineTransform)","",""
"org.geotools.data.shapefile.indexed.IndexedShapefileAttributeReader.hasNext()","1044","38269"
"org.geotools.data.FIDFeatureReader.hasNext()","",""
"org.geotools.data.FilteringFeatureReader.hasNext()","",""
"org.geotools.feature.FeatureReaderIterator.hasNext()","",""
"org.geotools.feature.collection.DelegateFeatureIterator.hasNext()","",""
"org.geotools.data.crs.ForceCoordinateSystemIterator.hasNext()","",""
"org.geotools.renderer.lite.StreamingRenderer.drawPlain(Graphics2D, MapLayer, AffineTransform, CoordinateReferenceSystem, String, Collection, FeatureCollection, NumberRange, ArrayList)","",""
"org.geotools.renderer.lite.StreamingRenderer.processStylers(Graphics2D, MapLayer, AffineTransform, CoordinateReferenceSystem, Envelope, Rectangle, String)","",""
"org.geotools.renderer.lite.StreamingRenderer.paint(Graphics2D, Rectangle, ReferencedEnvelope, AffineTransform)","",""
"org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(WMSMapContext, boolean)","",""
"org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(WMSMapContext)","",""
"org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(WMSMapContext)","",""
"org.geoserver.wms.GetMap.run(GetMapRequest, WMSMapContext)","",""
"org.geoserver.wms.GetMap.run(GetMapRequest)","",""
"org.geoserver.wms.DefaultWebMapService.getMap(GetMapRequest)","",""
"java.lang.reflect.Method.invoke(Object, Object[])","",""
"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[])","",""
"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint()","",""
"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()","",""
"org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(MethodInvocation)","",""
"org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(MethodInvocation)","",""
"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()","",""
"org.geoserver.gwc.wms.CachingWebMapService.invoke(MethodInvocation)","",""
"org.geoserver.gwc.wms.CachingWebMapService.invoke(MethodInvocation)","",""
"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()","",""
"org.geoserver.ows.util.RequestObjectLogger.invoke(MethodInvocation)","",""
"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()","",""
"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Object, Method, Object[])","",""
"java.lang.reflect.Method.invoke(Object, Object[])","",""
"org.geoserver.ows.Dispatcher.execute(Request, Operation)","",""
"org.geoserver.ows.Dispatcher.handleRequestInternal(HttpServletRequest, HttpServletResponse)","",""
"org.springframework.web.servlet.mvc.AbstractController.handleRequest(HttpServletRequest, HttpServletResponse)","",""
"org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(HttpServletRequest, HttpServletResponse, Object)","",""
"org.springframework.web.servlet.DispatcherServlet.doDispatch(HttpServletRequest, HttpServletResponse)","",""
"org.springframework.web.servlet.DispatcherServlet.doService(HttpServletRequest, HttpServletResponse)","",""
"org.springframework.web.servlet.FrameworkServlet.processRequest(HttpServletRequest, HttpServletResponse)","",""
"org.springframework.web.servlet.FrameworkServlet.doGet(HttpServletRequest, HttpServletResponse)","",""
"javax.servlet.http.HttpServlet.service(ServletRequest, ServletResponse)","",""
"org.mortbay.jetty.servlet.ServletHolder.handle(ServletRequest, ServletResponse)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.SpringDelegatingFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.platform.AdvancedDispatchFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterInvocation)","",""
"org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain)","",""
"org.springframework.security.ui.SpringSecurityFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain)","",""
"org.springframework.security.ui.SpringSecurityFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain)","",""
"org.springframework.security.ui.SpringSecurityFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain)","",""
"org.springframework.security.ui.SpringSecurityFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse)","",""
"org.springframework.security.util.FilterChainProxy.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.springframework.security.util.FilterToBeanProxy.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.LoggingFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.ReverseProxyFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"ch.lydon.TestFilter.TestFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.GZIPFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.geoserver.filters.SessionDebugFilter.doFilter(ServletRequest, ServletResponse, FilterChain)","",""
"org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletRequest, ServletResponse)","",""
"org.mortbay.jetty.servlet.ServletHandler.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.security.SecurityHandler.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.servlet.SessionHandler.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.handler.ContextHandler.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.webapp.WebAppContext.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.handler.ContextHandlerCollection.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.handler.HandlerCollection.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.handler.HandlerWrapper.handle(String, HttpServletRequest, HttpServletResponse, int)","",""
"org.mortbay.jetty.Server.handle(HttpConnection)","",""
"org.mortbay.jetty.HttpConnection.handleRequest()","",""
"org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete()","",""
"org.mortbay.jetty.HttpParser.parseNext()","",""
"org.mortbay.jetty.HttpParser.parseAvailable()","",""
"org.mortbay.jetty.HttpConnection.handle()","",""
"org.mortbay.io.nio.SelectChannelEndPoint.run()","",""
"org.mortbay.thread.BoundedThreadPool$PoolThread.run()","",""
"org.geotools.index.quadtree.LazySearchIterator.next()","62","38254" 

Subscribe to Lydon's blog

Get the latest posts delivered right to your inbox

Lydon

Lydon

Grow and grow and grow

Read More